package com.lines.chap02;

import java.io.*;
import java.util.Random;
import java.util.stream.IntStream;

/**
 * <p>
 * <code>BuildAgeData</code>
 * </p>
 *
 * @author junbao3
 * TODO
 * @date 2023-03-23 10:42
 * Copyright (C) 2021 IFlyTek. All rights reserved.
 */
public class BuildAgeData {
    public static void main(String[] args) throws IOException {
        String fileName = "F:\\age.txt";
        Random random = new Random();
        BufferedWriter bufferedWriter
                = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName)));
        IntStream.range(0,1400000000).forEach(i->{
            int age = Math.abs(random.nextInt()) % 130;
            try {
                bufferedWriter.write(age+"\r\n");
            } catch (IOException e) {
                e.printStackTrace();
            }
        });
        bufferedWriter.flush();
        bufferedWriter.close();

    }
}
